package com.kyyc.luff.testb.controller;

import com.alibaba.fastjson.JSON;
import com.kyyc.luff.core.result.ResultView;
import com.kyyc.luff.testb.fegin.RemoteTestaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/testb")
@RestController
@Slf4j
public class TestbController {

    @Autowired
    private RemoteTestaService remoteTestaService;


    @RequestMapping("/a")
    public ResultView a() {
        ResultView resultView = remoteTestaService.a();
        log.info("我是testb，我调用了testa的a请求，我请求的结果是：" + JSON.toJSONString(resultView));
        return ResultView.success("我是testb，我调用了testa的a请求，我请求的结果是：" + JSON.toJSONString(resultView));
    }

    @RequestMapping("/b")
    public ResultView b() {
        log.info("我是testb的b请求");
        return ResultView.success("我是testb的b请求");
    }
}
